//
//  CategoryCollectionViewCell.m
//  KeleAppProject
//
//  Created by Cen Zhou on 2018/1/16.
//  Copyright © 2018年 Cen Zhou. All rights reserved.
//

#import "CategoryCollectionViewCell.h"

@implementation CategoryCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self loadSubviewsOnCategoryCollectionCell];
    }
    return self;
}


- (void)loadSubviewsOnCategoryCollectionCell{
    
    UIView *backView = [[UIView alloc]init];
    backView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:backView];
    [backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.contentView);
        make.width.mas_equalTo(165*WIDTH);
        make.height.mas_equalTo(80*HEIGHT);
    }];
    
    UIImageView *typeImageView = [[UIImageView alloc]init];
    typeImageView.image = [UIImage imageNamed:@"home_icon_shouchang"];
    typeImageView.contentMode = UIViewContentModeScaleAspectFit;
    [backView addSubview:typeImageView];
    [typeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(36*WIDTH);
        make.centerY.equalTo(backView);
        make.left.equalTo(backView).offset(15*WIDTH);
    }];
    
    
    UILabel *typeTint = [[UILabel alloc]init];
    typeTint.text = @"分类名称";
    typeTint.textColor = KLColor_B6;
    typeTint.font = [UIFont fontWithName:@"PingFangSC-Medium" size:14*WIDTH];
    [backView addSubview:typeTint];
    [typeTint mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(typeImageView);
        make.left.equalTo(typeImageView.mas_right).offset(10*WIDTH);
    }];
    
    UILabel *videoNum = [[UILabel alloc]init];
    videoNum.text = @"共188个视频";
    videoNum.textColor = KLColor_B4;
    videoNum.font = [UIFont fontWithName:@"PingFangSC-Regular" size:12*WIDTH];
    [backView addSubview:videoNum];
    [videoNum mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(typeImageView);
        make.left.equalTo(typeTint);
    }];
    
    
}
@end
